import request from '@/utils/request'

// 查询BOM明细列表
export function listBomDetail(query) {
  return request({
    url: '/mes/bomDetail/list',
    method: 'get',
    params: query
  })
}

// 查询BOM明细详细
export function getBomDetail(detailId) {
  return request({
    url: '/mes/bomDetail/' + detailId,
    method: 'get'
  })
}

// 新增BOM明细
export function addBomDetail(data) {
  return request({
    url: '/mes/bomDetail',
    method: 'post',
    data: data
  })
}

// 修改BOM明细
export function updateBomDetail(data) {
  return request({
    url: '/mes/bomDetail',
    method: 'put',
    data: data
  })
}

// 删除BOM明细
export function delBomDetail(detailId) {
  return request({
    url: '/mes/bomDetail/' + detailId,
    method: 'delete'
  })
}

// 根据BOM ID查询明细列表
export function getBomDetailByBomId(bomId) {
  return request({
    url: '/mes/bomDetail/getByBomId/' + bomId,
    method: 'get'
  })
}

// 批量新增BOM明细
export function batchInsertBomDetail(data) {
  return request({
    url: '/mes/bomDetail/batchInsert',
    method: 'post',
    data: data
  })
}

// 根据BOM ID删除明细
export function deleteBomDetailByBomId(bomId) {
  return request({
    url: '/mes/bomDetail/deleteByBomId/' + bomId,
    method: 'delete'
  })
}